package com.ckzp.weixin.wxpay.data;

import com.ckzp.core.json.JsonUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * 退款数据明细
 * 网上地址：https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_4
 * Created by 51594 on 2022/1/24.
 */
public class RefundData {

    public static RefundData n() {
        return new RefundData();
    }

    //微信支付订单号
    public String transaction_id = "";
    //商户订单号
    public String out_trade_no = "";
    //商户退款单号
    public String out_refund_no = "";
    //退款原因
    public String reason = "报名费全额退费";
    //退款结果回调url
    public String notify_url = "https://www.demo.com/api/base/ScyWxRefundResult";
    //退款资金来源
    public String funds_account = "";
    //退款金额
    public Map amount = new HashMap();


    public void setAmmount(int ammount) {
        amount.put("refund", String.valueOf(ammount));//退款金额
        amount.put("total", String.valueOf(ammount));//原订单金额
        amount.put("currency", "CNY");//原订单金额
    }


    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getNotify_url() {
        return notify_url;
    }

    public void setNotify_url(String notify_url) {
        this.notify_url = notify_url;
    }

    public String getFunds_account() {
        return funds_account;
    }

    public void setFunds_account(String funds_account) {
        this.funds_account = funds_account;
    }

    public Map getAmount() {
        return amount;
    }

    public void setAmount(Map amount) {
        this.amount = amount;
    }

    public String toJson() {
        return JsonUtil.toJsonString(this);
    }
}
